<template>
   <iframe  src='http://47.97.25.8:8080/swagger/ui/index' class="iframe" ref="iframe" ></iframe>  
  
</template>
<script>
export default {
  name: "swaggerui",
  data() {
    return {
      fullscreenLoading: false,
      urlPath: this.getUrlPath()
    };
  },
  created() {
    this.fullscreenLoading = true;
  },
  mounted() {
    this.iframeInit();
    window.onresize = () => {
      this.iframeInit();
    };
  },
  methods: {
    iframeInit() {
      const iframe = this.$refs.iframe;
      const clientHeight = document.documentElement.clientHeight - 90;
      iframe.style.height = `${clientHeight}px`;
      if (iframe.attachEvent) {
        iframe.attachEvent("onload", () => {
          this.fullscreenLoading = false;
        });
      } else {
        iframe.onload = () => {
          this.fullscreenLoading = false;
        };
      }
    }
  }
};
</script>
<style>
.iframe {
  width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
  box-sizing: border-box;
}
</style>